﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExamSystem.BLL;
using ExamSystem.Mdeol;
namespace ExamSystem.ht
{
    public partial class TKecheng_Add : System.Web.UI.Page
    {
        private TkechengBLL tb = new TkechengBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //获取数据
            string tkcname = this.tkcName.Value;
            //验证
            if (string.IsNullOrEmpty(tkcname))
            {
                util.FunHelper.LayerAlter(this, "课程名称不能为空");
            }
            int i = tb.selecttkcname(tkcname);
            if (i > 0)
            {
                util.FunHelper.LayerAlter(this, "课程名重复");
            }
            else
            {
                int b = tb.inserttckecheng(tkcname);
                if (b > 0)
                {
                    util.FunHelper.LayerAlter(this, "添加成功", "TKecheng_List.aspx");
                }
                else
                {
                    util.FunHelper.LayerAlter(this, "添加失败");
                }
            }
        }
        protected void onclick(object sender, EventArgs e)
        {
            util.FunHelper.LayerAlter(this, "确定返回吗？", "TKecheng_List.aspx");
        }
    }
}